package com.eorchis.module.trainingneeds.domain;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import com.eorchis.core.basedao.entity.impl.AbstractBaseEntity;


import org.hibernate.annotations.GenericGenerator;

import com.eorchis.core.basedao.entity.IBaseEntity;
import com.eorchis.module.basedata.domain.BaseData;
import com.eorchis.module.user.domain.User;

/**
 * Title: QuestionBank<br>
 * Description: 培训需求题库表实体对象<br>
 * Company: GoldGov<br>
 * Copyright @ 2012 GoldGov .All rights reserved.<br>
 * @author HuangTF
 * @createDate 2014-02-07
 * @version $Revision$
 */
@Entity
@Table(name = "QUESTION_BANK")
public class QuestionBank extends AbstractBaseEntity implements IBaseEntity {
	private static final long serialVersionUID = 1L;

	/**
	 * 活动状态：活动
	 */
	public final static Integer IS_ACTIVE_Y = new Integer(1);
	/**
	 * 活动状态：作废
	 */
	public final static Integer IS_ACTIVE_N = new Integer(2);
	/**
	 * 试题题型：单选题 
	 */
	public final static String QUESTION_DAN = "danxt";
	/**
	 * 试题题型：多选题
	 */
	public final static String QUESTION_DUO = "duoxt";
	/**
	 * 试题题型：问答题
	 */
	public final static String QUESTION_WEN = "wendt";
	
	private String questionId;//试题ID
	private BaseData questionType;//试题题型
	private String questionName;//试题题干
	private User user;//创建人
	
	private Integer wordNum;//问答题字数上限(null为不限字数)
	
	private Integer questionTypes;//1数值型,2文字型
	private String questionsProblemSets;//试题题组
	
	@Id
	@GeneratedValue(generator = "system-uuid")
	@GenericGenerator(name = "system-uuid", strategy = "uuid")
	@Column(name="QUESTION_ID")
	/**
	 * 获取试题ID
	 */		
	public String getQuestionId() {
		return questionId;
	}
	/**
	 * 设置试题ID
	 */		
	public void setQuestionId(String questionId) {
		this.questionId = questionId;
	}
	/**
	 * 获取试题题型
	 */		
	@ManyToOne( fetch = FetchType.LAZY, optional = true)
	@JoinColumn(name = "QUESTION_TYPE", referencedColumnName = "DATA_CODE")
	public BaseData getQuestionType() {
		return questionType;
	}
	/**
	 * 设置试题题型
	 */		
	public void setQuestionType(BaseData questionType) {
		this.questionType = questionType;
	}
	/**
	 * 获取试题题干
	 */		
	@Column(name="QUESTION_NAME")
	public String getQuestionName() {
		return questionName;
	}
	/**
	 * 设置试题题干
	 */
	public void setQuestionName(String questionName) {
		this.questionName = questionName;
	}
	/**
	 * 获取创建人
	 */		
	@ManyToOne(fetch = FetchType.LAZY, optional = true)
	@JoinColumn(name="USERID")
	public User getUser() {
		return user;
	}
	/**
	 * 设置创建人
	 */		
	public void setUser(User user) {
		this.user = user;
	}
	/**
	 * 获取问答题字数上限
	 */		
	@Column(name="WORD_NUM")
	public Integer getWordNum() {
		return wordNum;
	}
	/**
	 * 设置问答题字数上限
	 */		
	public void setWordNum(Integer wordNum) {
		this.wordNum = wordNum;
	}
	
	/**
	 * 记录日志使用
	 */
	public String toString() {
		return "";
	}

	/**
	 * 获取是否为数值型的状态
	 */		
	@Column(name="IS_SCORE_TYPE")
	public Integer getQuestionTypes() {
		return questionTypes;
	}
	
	/**
	 * 设置是否为数值型的状态
	 */		
	public void setQuestionTypes(Integer questionTypes) {
		this.questionTypes = questionTypes;
	}
	
	/**
	 * 获取试题题组
	 */	
	@Column(name="QUESTIONS_PROBLEM_SETS")
	public String getQuestionsProblemSets() {
		return questionsProblemSets;
	}
	
	/**
	 * 设置试题题组
	 */	
	public void setQuestionsProblemSets(String questionsProblemSets) {
		this.questionsProblemSets = questionsProblemSets;
	}
}
